<?php


namespace Trawind\Remotes\Repositories\Account\Account;


use Trawind\Basics\Enums\ServiceDomain;
use Trawind\Remotes\BaseRepository;
use Trawind\Remotes\Contracts\Repositories\Account\Account\DepartmentRepository;

class DepartmentRepositoryEloquent extends BaseRepository implements DepartmentRepository
{

    public $baseRoute='/organization/departments';

    
    public function __construct()
    {
        $this->domain=ServiceDomain::ACCOUNT_DOMAIN();
    }


    public function all($columns = ['*'])
    {
        return $this->setUrl($this->baseRoute)->result();
    }
    
    
    public function create(array $attributes)
    {
        // TODO: Implement create() method.
    }

    public function update(array $attributes, $id)
    {
        // TODO: Implement update() method.
    }


    

    /**
     * @param $id
     * @param array $columns
     * @return mixed|null
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function find($id, $columns = ['*'])
    {
        return $this->setUrl($this->baseRoute.'/'.$id)->result();
    }

    /**
     * @inheritDoc
     */
    public function treatmentState(array $ids, $departmentStatus)
    {
        // TODO: Implement treatmentState() method.
    }

    /**
     * @inheritDoc
     */
    public function departmentChecked(array $params)
    {
        // TODO: Implement departmentChecked() method.
    }

    /**
     * @inheritDoc
     */
    public function deleteDepartment(array $ids)
    {
        // TODO: Implement deleteDepartment() method.
    }

    /**
     * @inheritDoc
     */
    public function affiliatedDepartmentTree(array $id)
    {
        // TODO: Implement affiliatedDepartmentTree() method.
    }

    /**
     * @inheritDoc
     */
    public function categoryOrganizational(array $id)
    {
        return $this->setUrl($this->baseRoute.'/category')
            ->setClientOptions(['form_params' => ['categorieIds'=>$id]])
            ->result('POST');
    }

    /**
     * @inheritDoc
     */
    public function getOrganizations(array $params)
    {
        return $this->setUrl($this->baseRoute.'/organizations')
            ->setClientOptions(['form_params' =>['organizations'=>$params]])
            ->result('POST');
    }
}
